package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: ContractService
 * @Date: Created in 14:09 2020/12/22
 * @Description: 合同信息服务
 */
@Service
@Slf4j
public class ContractService extends BaseService {


    /**
     * @Author YangYu
     * @Description 合同信息分页列表
     * @Date Created in 14:16 2020/12/22
     * @Param [jsonParam]
     */

    public RespEntity contractPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","contractPagList","contract");
    }

    /**
     * @Author YangYu
     * @Description 合同新增
     * @Date Created in 11:21 2020/12/28
     * @Param []
     */

    public RespEntity add(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","add","contract");
    }

    /**
     * @Author YangYu
     * @Description 合同更新
     * @Date Created in 11:22 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity update(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","update","contract");
    }

    /**
     * @Author YangYu
     * @Description 合同详情
     * @Date Created in 11:27 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity detail(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","detail","contract");
    }
    /**
     * @Author YangYu
     * @Description 合同删除
     * @Date Created in 11:27 2020/12/28
     * @Param [jsonParam]
     */

    public RespEntity delete(JSONObject jsonParam){
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","delete","contract");
    }
}
